//
//  ViewController.m
//  ShadowRoundedCornerDemo1
//
//  Created by 李煜 on 2024/5/13.
//

#import "ViewController.h"
#import "UIView+CornerShadow.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self methodName1];
    [self methodName2];
}

- (void)methodName1 {
    UIButton * button = [UIButton buttonWithType:0];
    [button setTitle:@"尿你一脸" forState:0];
    button.frame = CGRectMake(150, 200, 160, 60);
    button.backgroundColor = [UIColor orangeColor];
    [button addTarget:self action:@selector(btnClick) forControlEvents:1<<6];
    [self.view addSubview:button];
    //或者
    [button addCornersAndShadow];
}
- (void)methodName2 {
    UIButton * button = [UIButton buttonWithType:0];
    [button setTitle:@"尿你一脸" forState:0];
    button.frame = CGRectMake(150, 500, 160, 60);
    button.backgroundColor = [UIColor orangeColor];
    [button addTarget:self action:@selector(btnClick) forControlEvents:1<<6];
    [self.view addSubview:button];
    //或者
    [button addCorners:UIRectCornerTopRight|UIRectCornerBottomRight rRadii:30.0f shadowLayer:^(CALayer * _Nonnull shadowLayer) {
        shadowLayer.shadowOpacity = 0.5;
        shadowLayer.shadowOffset = CGSizeMake(5, 5);
        shadowLayer.shadowRadius = 10;
    }];
    NSLog(@"=======");

    
}
@end
